package com.qiusuo0226.core.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableCharset;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableEngine;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlCharsetConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlEngineConstant;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.qiusuo0226.mysql.pojo.CommonEntity;
import com.qiusuo0226.core.constant.Tables;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 接口访问记录 数据源对象
 * - @Data lombok getter、setter、toString、hash注解
 * - @AllArgsConstructor lombok 全参构造 注解
 * - @NoArgsConstructor lombok 无参构造 注解
 * - @TableName mybaitsPlus 表名 注解
 * - @Table actable 表名 注解
 * - @TableCharset actable 表编码 注解
 * - @TableEngine actable 引擎 注解
 * @author qiusuo
 * @date 2023/6/19 10:22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = Tables.CORE_USER_INFO)
@Table(name = Tables.CORE_USER_INFO, comment = "用户信息表")
@TableCharset(MySqlCharsetConstant.UTF8MB4)
@TableEngine(MySqlEngineConstant.InnoDB)
public class UserInfoDO extends CommonEntity implements Serializable {

    private static final long serialVersionUID = 1385403072698744309L;

    @TableField(value = "user_name")
    @Column(name = "user_name", type = MySqlTypeConstant.VARCHAR, length = 255, comment = "用户名", defaultValue = "", isNull=false)
    private String userName;

    @TableField(value = "user_account")
    @Column(name = "user_account", type = MySqlTypeConstant.VARCHAR, length = 255, comment = "用户账号", defaultValue = "", isNull=false)
    private String userAccount;

    @TableField(value = "user_pass")
    @Column(name = "user_pass", type = MySqlTypeConstant.VARCHAR, length = 255, comment = "用户密码", defaultValue = "", isNull=false)
    private String userPass;

    @TableField(value = "user_id_card")
    @Column(name = "user_id_card", type = MySqlTypeConstant.VARCHAR,  length = 255, comment = "用户身份证", defaultValue = "", isNull=false)
    private String userIdCard;

    @TableField(value = "user_phone")
    @Column(name = "user_phone", type = MySqlTypeConstant.VARCHAR,  length = 255, comment = "用户手机号", defaultValue = "", isNull=false)
    private String userPhone;

    @TableField(value = "gender")
    @Column(name = "gender", type = MySqlTypeConstant.VARCHAR,  length = 1, comment = "用户性别，男1女0", defaultValue = "1", isNull=false)
    private String gender;

    @TableField(value = "last_login_ip")
    @Column(name = "last_login_ip", type = MySqlTypeConstant.VARCHAR,  length = 255, comment = "最后登录IP", defaultValue = "", isNull=false)
    private String lastLoginIp;

    @TableField(value = "last_login_time")
    @Column(name = "last_login_time", type = MySqlTypeConstant.DATETIME, comment = "最后登录时间", defaultValue = "", isNull=true)
    private Date lastLoginTime;
}
